# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-antlerinator
_pkgname=antlerinator
pkgver=4.9.2
pkgrel=7
pkgdesc='Python utility package to help keeping components of ANTLR v4 in sync.'
arch=('any')
url='https://pypi.org/project/antlerinator/#files'
license=('BSD')
depends=('python' 'python-typing' 'python-antlr4')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b82bfda21f36cc730bd195f27a642986367dd7f800a6fdcac23d3aa3a7a4093f0f9eb47a963ece98e1a8f8696379e3a39257dd75d846d72453f401e10a52542f')

prepare() {
  cd "$_pkgname-$pkgver"

  find . -type f -exec \
    sed -i 's|antlr4-python3-runtime==4.9.2|antlr4-python3-runtime|g' {} \;
}

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

